package com.ts.utils.EGL

import android.R.bool
import android.opengl.EGLConfig
import android.opengl.EGLContext
import android.opengl.EGLSurface
import android.view.Surface



interface ICore {


    fun init(sharedContext: EGLContext?, flags:Int ):Boolean;
    fun getConfig(flags: Int, version: Int): EGLConfig?

    fun release();

    // 获取EglContext
    fun getEGLContext():EGLContext
    // 销毁Surface
    fun releaseSurface(eglSurface: EGLSurface)
    //  创建EGLSurface
    fun createWindowsSurface(surface: Surface):EGLSurface?
    // 创建离屏EGLSurface
    fun createOffscreenSurface(width:Int,height:Int):EGLSurface?
    // 切换到当前上下文
    fun makeCurrent(eglSurface:EGLSurface)
    // 切换到某个上下文
    fun makeCurrent(drawSurface: EGLSurface, readSurface: EGLSurface)

    fun makeNothingCurrent();

    fun swapBuffers(eglSurface:EGLSurface):Boolean

    fun setPresentationTime(eglSurface:EGLSurface,nsecs:Long)


    fun isCurrent(eglSurface: EGLSurface): Boolean

    // 执行查询
    fun querySurface(eglSurface: EGLSurface?, what: Int): Int

    fun checkEglError()
}